{extend name="layout/layout" /}

{block name="content"}
<div class="row">
    <div class="col-md-12">
        <div class="portlet light">
            <div class="portlet-title">
                <div class="caption">
                    <i class="icon-share font-dark"></i>
                    <span class="caption-subject font-dark bold uppercase"> 添加管理员</span>
                </div>
                <div class="actions">
                    <a class="btn btn-circle btn-icon-only btn-default fullscreen" href="javascript:;" data-original-title="" title=""> </a>
                </div>
            </div>
            <div class="portlet-body">
                <form class="form-horizontal" method="post" enctype="multipart/form-data">
                    <div class="form-body">
                        <div class="row" style="margin-bottom: 20px;">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        管理人
                                        <span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <div class="form-inline">
                                            <select class="form-control areaLists" name="departmentId" onchange="getAccessPensonList(this,type='pensonList')" >
                                                <option value="0">请选择</option>
                                                {volist name="department" id="vo"}
                                                <option value="{$vo.id}">{$vo.name}</option>
                                                {/volist}
                                            </select>
                                            <select class="form-control pensonList areaLists" name="personId"></select>
                                            <span style="color: #adadad;margin-left: 10px;">（这里添加的管理人员可以登录后台）</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        管理权限<span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        {volist name="menu" id="vo"}
                                            {volist name="vo" id="mm"}
                                                <label class="mt-checkbox" style="width: 120px;">
                                                    <input type="checkbox" name="menuId" value="{$mm.id}"> {$mm.menu_name}
                                                    <span></span>
                                                </label>

                                            {/volist}
                                            <br />
                                        {/volist}
                                    </div>
                                </div>
                            </div>
                        </div>
                        <hr />
                        <input type="hidden" name="posttype" value="add">
                        <div class="row">
                            <div class="form-actions">
                                <div class="col-md-offset-2 col-md-10">
                                    <button type="button" id="form-submit" class="btn blue save-btn">
                                        保存 <i class="fa fa-floppy-o"></i>
                                    </button>
                                    <button type="button" class="btn default" onclick="history.go(-1);">
                                        返回 <i class="fa fa-mail-forward"></i>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<input type="hidden" class="token_url" value="{:url('admin/Image/token')}">
<input type="hidden" class="record_url" value="{:url('admin/Image/record')}">
<input type="hidden" class="delimage_url" value="{:url('admin/Image/delete')}">
{/block}

{block name="pagescript"}
<script>
    var posturl = "{:url('admin/'.strtolower($model).'/addPost')}";
    var partylist = "{:url('admin/layer/partyList')}";
    var getAccessPensonurl = "{:url('admin/layer/getAccessPensonList')}";
</script>
<script src="__STATIC__/admin/pages/js/setadmin.js?v={:time()}" type="text/javascript"></script>
{/block}